package com.changhong.disruptorsource.quickstart;

import com.lmax.disruptor.EventFactory;

import java.util.concurrent.atomic.AtomicInteger;

public class OrderEventFactory implements EventFactory<OrderEvent> {

	private static AtomicInteger count = new AtomicInteger(0);

	@Override
	public OrderEvent newInstance() {
		System.out.println("newInstance " + count.incrementAndGet());
		return new OrderEvent();		//这个方法就是为了返回空的数据对象（Event）
	}

}
